var rootPath = getRootPath();

$(function() {
	$("#save").click(function() {
		var nid = $("#nid").val();
		var eid = $("#eid").val();
		var company = $("#company").val();
		var profession = $("#profession").val();
		var tagNames = $("#selectTags").val();
		
		showLoading();
		$.ajax({
			url: rootPath + '/userDetailFront/updateDetailInfo',
	        type: 'POST',
	        data: JSON.stringify({
	        	"nid" : nid,
	        	"eid" : eid,
	        	"company" : company,
	        	"profession" : profession,
	        	"tagNames" : tagNames
	        }),
	        contentType: 'application/json;charset=UTF-8',
	        success: function (data) {
	        	hideLoading();
	        	if(data.returnCode == '0000') {
	        		layer.msg("更新成功",{icon:6,time:1000});
	        	} else {
	        		layer.alert(data.returnMessage);
	        	}
	        },
	        error: function (jqXHR, textStatus, errorThrown) {
	        	hideLoading();
	        	layer.alert("error");
	        }
	    });
	});
});